1. Field of the Invention
The present invention relates to an image inspecting apparatus and an image inspecting method, and particularly relates to an image inspecting apparatus employed in an image output apparatus for outputting an image recording medium on which an image has been recorded based upon image data and image inspecting method therefor.
2. Description of the Related Art
Conventionally, as a method of inspecting a defect contained in an output image, a defect inspecting method based upon a normalized correlation method has been proposed. This defect inspecting method owns such a merit that a defect inspection can be carried out in a correct manner even when contrast of a scanned image for inspection is different from that of a reference image due to a change in illumination conditions.
A normalized correlation value C between a template image T(i, j) having N×M pixels, which is produced from reference image data, and an image I(i, j), which is extracted from a scanned image for inspection, is calculated in accordance with the following formula 1:
                                                        C              =                                                                    ∑                                          i                      =                      1                                        N                                    ⁢                                                            ∑                                              j                        =                        1                                            M                                        ⁢                                                                  {                                                                              I                            ⁡                                                          (                                                              i                                ,                                j                                                            )                                                                                -                                                      μ                            ⁢                                                                                                                  ⁢                            I                                                                          }                                            ·                                              {                                                                              T                            ⁡                                                          (                                                              i                                ,                                j                                                            )                                                                                -                                                      μ                            ⁢                                                                                                                  ⁢                            T                                                                          }                                                                                                                                                        ∑                                              i                        =                        1                                            N                                        ⁢                                                                  ∑                                                  j                          =                          1                                                M                                            ⁢                                                                                                    {                                                                                          I                                ⁡                                                                  (                                                                      i                                    ,                                    j                                                                    )                                                                                            -                                                              μ                                ⁢                                                                                                                                  ⁢                                I                                                                                      }                                                    2                                                ·                                                                              ∑                                                          i                              =                              1                                                        N                                                    ⁢                                                                                    ∑                                                              j                                =                                1                                                            M                                                        ⁢                                                                                          {                                                                                                      T                                    ⁡                                                                          (                                                                              i                                        ,                                        j                                                                            )                                                                                                        -                                                                      μ                                    ⁢                                                                                                                                                  ⁢                                    T                                                                                                  }                                                            2                                                                                                                                                                                                                                                                  μ                ⁢                                                                  ⁢                I                            =                                                1                  NM                                ·                                                      ∑                                          i                      =                      1                                        N                                    ⁢                                                            ∑                                              j                        =                        1                                            M                                        ⁢                                          I                      ⁡                                              (                                                  i                          ,                          j                                                )                                                                                                                                                                                    μ                ⁢                                                                  ⁢                T                            =                                                1                  NM                                ·                                                      ∑                                          i                      =                      1                                        N                                    ⁢                                                            ∑                                              j                        =                        1                                            M                                        ⁢                                          T                      ⁡                                              (                                                  i                          ,                          j                                                )                                                                                                                                                    (        1        )            
The normalized correlation value C becomes 1 when the template image is completely coincident with the image extracted from the scanned image for inspection. On the other hand, the normalized correlation value C becomes −1 when the template image completely disagrees with the image extracted from the scanned image for inspection (when template image and extracted image represent patterns, are inverted in light and shade with each other).
In an actual defect inspecting apparatus, a template image corresponds to ideal defectless data, which contains no noise, whereas a scanned image for inspection corresponds to image data, which is digital data into which an image is converted, which is recorded on an image recording medium and outputted from an image output apparatus. Therefore, errors and noise produced from a converting unit for conducting conversion into digital data are mixed into the scanned image for inspection.
As a result, even when a scanned image for inspection has no defect, normalized correlation value thereof is not always equal to 1. Therefore, when the normalized correlation value is larger than, or equal to a predetermined threshold value, such a judgement can be made that the reference image is coincident with the scanned image for inspection, and thus, the scanned image for inspection has no defect.
As to this defect inspecting method based upon the normalized inspection, several problems have been pointed out and solution measures have been proposed in the following related art.
In “image matching method and image matching apparatus” disclosed in JP-A-Hei.9-62841, when an image has a low gray scale value (dark image portion) such as a background of an image, the defect inspection based on the normalized correlation value in which a portion having a higher correlation value is forcibly sought owns a problem. In this example, while the correlation value C is calculated, the accumulated value of the gray scale values themselves is employed instead of such an accumulated value obtained after gray scale values have been corrected based upon difference between an average level and the gray scale values. As a consequence, such an error contained in the normalized correlation value can be avoided in the dark background where the gray scale value has no value.
Also, in “correlation value correcting apparatus/method of normalized correlative correlation values in pattern matching” disclosed in JP-A-Hei.7-121711, the following problem is pointed out. That is, even when the normalized correlation value is equal to 1, both the scanned image for inspection and the reference image are not always images, which are captured from an object having the same reflectance factor distribution. In this example, a correction amount is determined based on an average value of gray scale values of the reference image, an average value of gray scale values of the scanned image for inspection, a standard deviation of the scanned image for inspection, and a standard deviation of the reference image to correct the correction value.
However, there are some cases that the normalized correlation value cannot be calculated by the template image, which is produced from the reference image in view of the defect inspections executed over the entire area of the output image.
For instance, this case corresponds to a case in which there is no change in gray scale values within the template image of the reference image and the template image is produced in a margin portion located at a peripheral portion of a document where characters are written or a portion having uniform gray scale values such as a figure. In this case, the template image T(i, j) defined in the above-described formula does not depend upon i and j; each of gray scale values within the template image becomes equal to an average value (T(i, j)=μT), a denominator and a numerator of a right hand in the above-described formula becomes zero; and thus, the normalized correlation value C becomes unstable. In other words, when a defect is present at a position of this portion of the scanned image for inspection, the defect inspection cannot be carried out.
In accordance with the technique disclosed in JP-A-Hei.62841, even when there is no change in the gray scale values within the template image of the reference image, the correlation value can be calculated. However, this technique owns the following serious drawback. That is, the higher robustness of the image matching apparatus are lost with respect to the offset variation of the gray scale values of the image and the variation of the illumination light amount, which corresponds to the merit of the defect inspection caused by the normalized correlation of this image matching apparatus.
Also, in the technique disclosed in JP-A-Hei.7-121711, when there is no change in the gray scale values within the template image of the reference image, such a basic problem cannot be solved. That is, this technique cannot calculate the normalized correlation value.